package com.zhang.pojo;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.time.LocalDate;

/**
 * 学生实体类
 */
@Data
@NoArgsConstructor
@ToString
public class Student {
        /**学生编号*/
        private int id;
        /**学生名称*/
        private String name;
        /**学生生日*/
        private LocalDate birthday;
        /**学生电话*/
        private String phone;
        /**学生班级*/
        private Classes classes;

    public Student(String name, LocalDate birthday, String phone, int classId) {
        this.name = name;
        this.birthday = birthday;
        this.phone = phone;
        this.classes = new Classes();
        this.classes.setId(classId);
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", birthday=" + birthday +
                ", phone='" + phone + '\'' +
                ", classes=" + classes +
                '}'+"\n";
    }
}
